package com.emmmya.ocs.modules.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.emmmya.harinCheck.annotation.Check;
import com.emmmya.ocs.common.base.BaseEntity;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author Exrick
 */
@Data
@Entity
@Table(name = "h_department")
@TableName("h_department")
// 部门
public class Department extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @Check(name = "部门名称")
    private String title;

    @Check(name = "父id")
    private String parentId;

    @Check(name = "是否为父节点(含子节点) 默认false")
    private Boolean isParent = false;

    @Check(name = "排序值")
    @Column(precision = 10, scale = 2)
    private BigDecimal sortOrder;

    @Check(name = "是否启用 0启用 -1禁用")
    private Integer status = 0;

    @Transient
    @TableField(exist=false)
    @Check(name = "父节点名称")
    private String parentTitle;

    @Transient
    @TableField(exist=false)
    @Check(name = "主负责人")
    private List<String> mainHeader;

    @Transient
    @TableField(exist=false)
    @Check(name = "副负责人")
    private List<String> viceHeader;
}